-
Notifications
You must be signed in to change notification settings - Fork 619
[SDK] Add buttonLabel prop to checkout widgets #7805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SDK] Add buttonLabel prop to checkout widgets #7805
Conversation
Co-authored-by: joaquim.verges <[email protected]>
🦋 Changeset detectedLatest commit: 001326c The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe changes introduce an optional Changes
Sequence Diagram(s)sequenceDiagram
participant Consumer as Consumer (e.g., Storybook or App)
participant Widget as Widget Component (e.g., FundWallet)
participant UI as UI Element (Button)
Consumer->>Widget: Passes buttonLabel prop (optional)
Widget->>Widget: Includes buttonLabel in uiOptions
Widget->>UI: Renders button with uiOptions.buttonLabel (if provided)
UI-->>Consumer: Displays custom or default button label
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes were found. Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
packages/thirdweb/src/stories/Bridge/fixtures.ts (3)
686-688: Consider alphabetically ordering the union keys for easier scanning
"customButton"is appended at the end of the union string, breaking the previously-alphabetised order (ethDefault,ethWithAmount,uniLarge,usdcDefault).
Keeping these literals alphabetised makes large fixture objects easier to diff and maintain over time.
734-736: Apply the same key ordering nit to Direct Payment variantsFor consistency with neighbouring code, consider alphabetising the literal list so
"customButton"sits between"credits"and"digitalArt".
825-827: Maintain alphabetical ordering of Transaction variant keysSame style nit: move
"customButton"to keep the literal list ordered (contractInteraction,customButton,erc20Transfer,ethTransfer).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx(1 hunks)packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx(3 hunks)packages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsx(2 hunks)packages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsx(1 hunks)packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx(1 hunks)packages/thirdweb/src/react/web/ui/Bridge/TransactionPayment.tsx(1 hunks)packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx(2 hunks)packages/thirdweb/src/stories/Bridge/DirectPayment.stories.tsx(1 hunks)packages/thirdweb/src/stories/Bridge/FundWallet.stories.tsx(1 hunks)packages/thirdweb/src/stories/Bridge/TransactionPayment.stories.tsx(1 hunks)packages/thirdweb/src/stories/Bridge/fixtures.ts(4 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}
📄 CodeRabbit Inference Engine (CLAUDE.md)
**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from@/typesor localtypes.tsbarrels
Prefer type aliases over interface except for nominal shapes
Avoidanyandunknownunless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial,Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
Files:
packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsxpackages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsxpackages/thirdweb/src/react/web/ui/Bridge/TransactionPayment.tsxpackages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsxpackages/thirdweb/src/stories/Bridge/DirectPayment.stories.tsxpackages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsxpackages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsxpackages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsxpackages/thirdweb/src/stories/Bridge/TransactionPayment.stories.tsxpackages/thirdweb/src/stories/Bridge/FundWallet.stories.tsxpackages/thirdweb/src/stories/Bridge/fixtures.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit Inference Engine (CLAUDE.md)
Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)
Files:
packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsxpackages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsxpackages/thirdweb/src/react/web/ui/Bridge/TransactionPayment.tsxpackages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsxpackages/thirdweb/src/stories/Bridge/DirectPayment.stories.tsxpackages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsxpackages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsxpackages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsxpackages/thirdweb/src/stories/Bridge/TransactionPayment.stories.tsxpackages/thirdweb/src/stories/Bridge/FundWallet.stories.tsxpackages/thirdweb/src/stories/Bridge/fixtures.ts
**/*.stories.tsx
📄 CodeRabbit Inference Engine (CLAUDE.md)
For new UI components, add Storybook stories (
*.stories.tsx) alongside the code
Files:
packages/thirdweb/src/stories/Bridge/DirectPayment.stories.tsxpackages/thirdweb/src/stories/Bridge/TransactionPayment.stories.tsxpackages/thirdweb/src/stories/Bridge/FundWallet.stories.tsx
🧠 Learnings (21)
📓 Common learnings
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Prefer composable primitives over custom markup: `Button`, `Input`, `Select`, `Tabs`, `Card`, `Sidebar`, `Separator`, `Badge`.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.stories.tsx : For new UI components, add Storybook stories (`*.stories.tsx`) alongside the code
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Reuse core UI primitives; avoid re-implementing buttons, cards, modals.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Always import from the central UI library under `@/components/ui/*` – e.g. `import { Button } from "@/components/ui/button"`.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Surface breaking changes prominently in PR descriptions
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Import UI primitives from `@/components/ui/*` (Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps
Learnt from: arcoraven
PR: thirdweb-dev/js#7505
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx:186-204
Timestamp: 2025-07-10T10:18:33.238Z
Learning: The ThirdwebBarChart component in apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx does not accept standard accessibility props like `aria-label` and `role` in its TypeScript interface, causing compilation errors when added.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/components/*.{stories,test}.{tsx,ts} : Provide a Storybook story (`MyComponent.stories.tsx`) or unit test alongside the component.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{tsx} : Expose `className` prop on root element of components for overrides
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Use `NavLink` (`@/components/ui/NavLink`) for internal navigation so active states are handled automatically.
📚 Learning: applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : import ui primitives from `@/components/u...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Import UI primitives from `@/components/ui/*` (Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps
Applied to files:
packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsxpackages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsxpackages/thirdweb/src/stories/Bridge/DirectPayment.stories.tsxpackages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsxpackages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsxpackages/thirdweb/src/stories/Bridge/TransactionPayment.stories.tsxpackages/thirdweb/src/stories/Bridge/FundWallet.stories.tsxpackages/thirdweb/src/stories/Bridge/fixtures.ts
📚 Learning: the modulecarduiprops interface already includes a client prop of type thirdwebclient, so when compo...
Learnt from: MananTank
PR: thirdweb-dev/js#7227
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/OpenEditionMetadata.tsx:26-26
Timestamp: 2025-05-30T17:14:25.332Z
Learning: The ModuleCardUIProps interface already includes a client prop of type ThirdwebClient, so when components use `Omit<ModuleCardUIProps, "children" | "updateButton">`, they inherit the client prop without needing to add it explicitly.
Applied to files:
packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsxpackages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsxpackages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsxpackages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsxpackages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsxpackages/thirdweb/src/stories/Bridge/fixtures.ts
📚 Learning: the thirdwebbarchart component in apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(side...
Learnt from: arcoraven
PR: thirdweb-dev/js#7505
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx:186-204
Timestamp: 2025-07-10T10:18:33.238Z
Learning: The ThirdwebBarChart component in apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx does not accept standard accessibility props like `aria-label` and `role` in its TypeScript interface, causing compilation errors when added.
Applied to files:
packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsxpackages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsxpackages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsxpackages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsxpackages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsx
📚 Learning: applies to dashboard/**/*.{tsx,jsx} : always import from the central ui library under `@/components/...
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Always import from the central UI library under `@/components/ui/*` – e.g. `import { Button } from "@/components/ui/button"`.
Applied to files:
packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsxpackages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsxpackages/thirdweb/src/stories/Bridge/DirectPayment.stories.tsxpackages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsxpackages/thirdweb/src/stories/Bridge/TransactionPayment.stories.tsxpackages/thirdweb/src/stories/Bridge/FundWallet.stories.tsx
📚 Learning: applies to dashboard/**/*client.tsx : interactive ui that relies on hooks (`usestate`, `useeffect`, ...
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Interactive UI that relies on hooks (`useState`, `useEffect`, React Query, wallet hooks).
Applied to files:
packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsxpackages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsxpackages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsxpackages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsxpackages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsxpackages/thirdweb/src/stories/Bridge/FundWallet.stories.tsxpackages/thirdweb/src/stories/Bridge/fixtures.ts
📚 Learning: in the onramp webhook schema (`packages/thirdweb/src/bridge/webhook.ts`), the `currencyamount` field...
Learnt from: gregfromstl
PR: thirdweb-dev/js#7450
File: packages/thirdweb/src/bridge/Webhook.ts:57-81
Timestamp: 2025-06-26T19:46:04.024Z
Learning: In the onramp webhook schema (`packages/thirdweb/src/bridge/Webhook.ts`), the `currencyAmount` field is intentionally typed as `z.number()` while other amount fields use `z.string()` because `currencyAmount` represents fiat currency amounts in decimals (like $10.50), whereas other amount fields represent token amounts in wei (very large integers that benefit from bigint representation). The different naming convention (`currencyAmount` vs `amount`) reflects this intentional distinction.
Applied to files:
packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsxpackages/thirdweb/src/react/web/ui/Bridge/TransactionPayment.tsxpackages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsxpackages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsxpackages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsxpackages/thirdweb/src/stories/Bridge/fixtures.ts
📚 Learning: applies to packages/thirdweb/src/wallets/** : unified `wallet` and `account` interfaces in wallet ar...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : Unified `Wallet` and `Account` interfaces in wallet architecture
Applied to files:
packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsxpackages/thirdweb/src/stories/Bridge/fixtures.ts
📚 Learning: applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : use design system tokens (e.g., `bg-card`...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Use design system tokens (e.g., `bg-card`, `border-border`, `text-muted-foreground`)
Applied to files:
packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsxpackages/thirdweb/src/stories/Bridge/DirectPayment.stories.tsxpackages/thirdweb/src/stories/Bridge/TransactionPayment.stories.tsxpackages/thirdweb/src/stories/Bridge/FundWallet.stories.tsxpackages/thirdweb/src/stories/Bridge/fixtures.ts
📚 Learning: the `transfer` function from `thirdweb/extensions/erc20` accepts human-readable amounts via the `amo...
Learnt from: MananTank
PR: thirdweb-dev/js#7298
File: apps/dashboard/src/app/nebula-app/move-funds/move-funds.tsx:255-277
Timestamp: 2025-06-06T23:47:55.122Z
Learning: The `transfer` function from `thirdweb/extensions/erc20` accepts human-readable amounts via the `amount` property and automatically handles conversion to base units (wei) by fetching the token decimals internally. Manual conversion using `toWei()` is not required when using the `amount` property.
Applied to files:
packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx
📚 Learning: applies to dashboard/**/*.{tsx,jsx} : stick to design-tokens: background (`bg-card`), borders (`bord...
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Stick to design-tokens: background (`bg-card`), borders (`border-border`), muted text (`text-muted-foreground`) etc.
Applied to files:
packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsxpackages/thirdweb/src/stories/Bridge/DirectPayment.stories.tsxpackages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsxpackages/thirdweb/src/stories/Bridge/TransactionPayment.stories.tsxpackages/thirdweb/src/stories/Bridge/FundWallet.stories.tsx
📚 Learning: applies to dashboard/**/*.{tsx,jsx} : reuse core ui primitives; avoid re-implementing buttons, cards...
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Reuse core UI primitives; avoid re-implementing buttons, cards, modals.
Applied to files:
packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsxpackages/thirdweb/src/stories/Bridge/DirectPayment.stories.tsxpackages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsxpackages/thirdweb/src/stories/Bridge/TransactionPayment.stories.tsxpackages/thirdweb/src/stories/Bridge/FundWallet.stories.tsxpackages/thirdweb/src/stories/Bridge/fixtures.ts
📚 Learning: applies to packages/thirdweb/src/wallets/** : support for in-app wallets (social/email login)...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : Support for in-app wallets (social/email login)
Applied to files:
packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx
📚 Learning: applies to dashboard/**/*.{tsx,jsx} : prefer composable primitives over custom markup: `button`, `in...
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Prefer composable primitives over custom markup: `Button`, `Input`, `Select`, `Tabs`, `Card`, `Sidebar`, `Separator`, `Badge`.
Applied to files:
packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsxpackages/thirdweb/src/stories/Bridge/DirectPayment.stories.tsxpackages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsxpackages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsxpackages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsxpackages/thirdweb/src/stories/Bridge/TransactionPayment.stories.tsxpackages/thirdweb/src/stories/Bridge/FundWallet.stories.tsx
📚 Learning: applies to **/*.stories.tsx : for new ui components, add storybook stories (`*.stories.tsx`) alongsi...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.stories.tsx : For new UI components, add Storybook stories (`*.stories.tsx`) alongside the code
Applied to files:
packages/thirdweb/src/stories/Bridge/DirectPayment.stories.tsxpackages/thirdweb/src/stories/Bridge/TransactionPayment.stories.tsxpackages/thirdweb/src/stories/Bridge/FundWallet.stories.tsx
📚 Learning: applies to dashboard/**/components/*.{stories,test}.{tsx,ts} : provide a storybook story (`mycompone...
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/components/*.{stories,test}.{tsx,ts} : Provide a Storybook story (`MyComponent.stories.tsx`) or unit test alongside the component.
Applied to files:
packages/thirdweb/src/stories/Bridge/DirectPayment.stories.tsxpackages/thirdweb/src/stories/Bridge/TransactionPayment.stories.tsxpackages/thirdweb/src/stories/Bridge/FundWallet.stories.tsx
📚 Learning: surface breaking changes prominently in pr descriptions...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Surface breaking changes prominently in PR descriptions
Applied to files:
packages/thirdweb/src/stories/Bridge/DirectPayment.stories.tsxpackages/thirdweb/src/stories/Bridge/TransactionPayment.stories.tsx
📚 Learning: applies to dashboard/**/*.{tsx,jsx} : for notices & skeletons rely on `announcementbanner`, `generic...
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : For notices & skeletons rely on `AnnouncementBanner`, `GenericLoadingPage`, `EmptyStateCard`.
Applied to files:
packages/thirdweb/src/stories/Bridge/DirectPayment.stories.tsx
📚 Learning: applies to dashboard/**/*.{tsx,jsx} : use `navlink` (`@/components/ui/navlink`) for internal navigat...
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Use `NavLink` (`@/components/ui/NavLink`) for internal navigation so active states are handled automatically.
Applied to files:
packages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsx
📚 Learning: applies to packages/thirdweb/src/wallets/** : eip-1193, eip-5792, eip-7702 standard support in walle...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules
Applied to files:
packages/thirdweb/src/stories/Bridge/FundWallet.stories.tsxpackages/thirdweb/src/stories/Bridge/fixtures.ts
📚 Learning: applies to test/src/test-wallets.ts : predefined test accounts are in `test/src/test-wallets.ts`...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to test/src/test-wallets.ts : Predefined test accounts are in `test/src/test-wallets.ts`
Applied to files:
packages/thirdweb/src/stories/Bridge/fixtures.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: Size
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: Unit Tests
- GitHub Check: Lint Packages
- GitHub Check: Build Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (17)
packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx (1)
45-45: LGTM! Clean foundational type addition.The optional
buttonLabelproperty is well-placed within theUIOptionstype and follows consistent typing patterns. This serves as the foundation for button label customization across all Bridge components.packages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsx (2)
190-194: Well-documented prop addition.The
buttonLabelprop is properly typed and documented with clear JSDoc comments, following the established pattern of other props in the interface.
318-318: Correct prop propagation.The
buttonLabelis properly passed through to the UI options, ensuring it reaches the underlying Bridge components that will render the customized button labels.packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx (2)
339-339: Perfect fallback implementation.The conditional rendering correctly uses
uiOptions.buttonLabelwhen provided, otherwise falls back to the dynamic labelBuy ${amount} ${uiOptions.destinationToken.symbol}. This maintains full backward compatibility while enabling customization.
345-345: Consistent ConnectButton handling.The ConnectButton label implementation matches the main button's approach, ensuring consistent behavior across both connected and disconnected states.
packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx (2)
193-197: Consistent prop documentation.The
buttonLabelprop follows the same documentation pattern as other widget components, maintaining consistency across the Bridge UI.
357-357: Proper data flow integration.The
buttonLabelis correctly included in the UI options data structure, ensuring it's available to downstream components for rendering customized button labels.packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx (2)
184-188: Complete widget interface consistency.The
buttonLabelprop maintains the same documentation and typing pattern across all Bridge widget components, ensuring a unified API experience.
343-343: Comprehensive flow coverage.The
buttonLabelis properly included in both the native token purchase flow and the specified token purchase flow, ensuring the customization feature works regardless of the token type being purchased.Also applies to: 374-374
packages/thirdweb/src/react/web/ui/Bridge/TransactionPayment.tsx (1)
115-115: LGTM! Clean implementation of custom button label.The conditional logic properly falls back to the default label when
buttonLabelis not provided, maintaining full backward compatibility.packages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsx (1)
67-86: LGTM! Conditional rendering handles both custom and default button labels correctly.The implementation properly preserves the original UI with price display when no custom label is provided, while showing clean custom text when
buttonLabelis specified.packages/thirdweb/src/stories/Bridge/DirectPayment.stories.tsx (1)
227-255: LGTM! Well-structured Storybook stories for the custom button label feature.The stories follow the established pattern, provide clear documentation, and properly demonstrate both light and dark theme variants of the custom button functionality.
packages/thirdweb/src/stories/Bridge/TransactionPayment.stories.tsx (1)
172-200: LGTM! Consistent Storybook implementation for transaction custom button labels.The stories properly demonstrate the custom button label feature with clear documentation and consistent theming patterns.
packages/thirdweb/src/stories/Bridge/FundWallet.stories.tsx (1)
198-226: LGTM! Comprehensive Storybook coverage for FundWallet custom button labels.The stories maintain consistency with the other bridge component stories and provide clear documentation of the custom button functionality.
packages/thirdweb/src/stories/Bridge/fixtures.ts (3)
721-730:buttonLabelwired into the Fund Wallet fixture looks correctThe new
customButtonvariant cleanly demonstrates the feature: the label is placed at the root (not insidemetadata),modeis set appropriately, and other required fields are present.
807-821: Direct PaymentcustomButtonvariant looks goodAll mandatory properties (
paymentInfo,mode,metadata) are present and thebuttonLabelis correctly placed. No issues spotted.
853-861: TransactioncustomButtonvariant is validThe variant correctly forwards the pre-prepared
ethTransferTransactionand includes the newbuttonLabelprop. ✅
size-limit report 📦
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #7805 +/- ##
==========================================
- Coverage 56.35% 56.34% -0.01%
==========================================
Files 905 905
Lines 58796 58806 +10
Branches 4143 4144 +1
==========================================
Hits 33135 33135
- Misses 25556 25567 +11
+ Partials 105 104 -1
🚀 New features to boost your workflow:
|
Co-authored-by: joaquim.verges <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.changeset/upset-pears-unite.md (1)
5-6: Clarify the changeset summaryIncluding the actual prop name improves traceability in release notes and searchability.
-Add ability to override button label for all payment widgets +Add optional `buttonLabel` prop to payment widgets to override the CTA text
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
.changeset/upset-pears-unite.md(1 hunks)apps/playground-web/src/app/payments/embed/RightSection.tsx(3 hunks)packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx(1 hunks)packages/thirdweb/src/stories/Bridge/DirectPayment.stories.tsx(1 hunks)packages/thirdweb/src/stories/Bridge/FundWallet.stories.tsx(1 hunks)packages/thirdweb/src/stories/Bridge/TransactionPayment.stories.tsx(1 hunks)packages/thirdweb/src/stories/Bridge/fixtures.ts(4 hunks)
✅ Files skipped from review due to trivial changes (2)
- packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx
- packages/thirdweb/src/stories/Bridge/FundWallet.stories.tsx
🚧 Files skipped from review as they are similar to previous changes (4)
- apps/playground-web/src/app/payments/embed/RightSection.tsx
- packages/thirdweb/src/stories/Bridge/DirectPayment.stories.tsx
- packages/thirdweb/src/stories/Bridge/TransactionPayment.stories.tsx
- packages/thirdweb/src/stories/Bridge/fixtures.ts
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Prefer composable primitives over custom markup: `Button`, `Input`, `Select`, `Tabs`, `Card`, `Sidebar`, `Separator`, `Badge`.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.stories.tsx : For new UI components, add Storybook stories (`*.stories.tsx`) alongside the code
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Reuse core UI primitives; avoid re-implementing buttons, cards, modals.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Always import from the central UI library under `@/components/ui/*` – e.g. `import { Button } from "@/components/ui/button"`.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Surface breaking changes prominently in PR descriptions
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Import UI primitives from `@/components/ui/*` (Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps
Learnt from: arcoraven
PR: thirdweb-dev/js#7505
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx:186-204
Timestamp: 2025-07-10T10:18:33.238Z
Learning: The ThirdwebBarChart component in apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx does not accept standard accessibility props like `aria-label` and `role` in its TypeScript interface, causing compilation errors when added.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/components/*.{stories,test}.{tsx,ts} : Provide a Storybook story (`MyComponent.stories.tsx`) or unit test alongside the component.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{tsx} : Expose `className` prop on root element of components for overrides
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Use `NavLink` (`@/components/ui/NavLink`) for internal navigation so active states are handled automatically.
📚 Learning: surface breaking changes prominently in pr descriptions...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Surface breaking changes prominently in PR descriptions
Applied to files:
.changeset/upset-pears-unite.md
📚 Learning: applies to packages/thirdweb/src/wallets/** : support for in-app wallets (social/email login)...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : Support for in-app wallets (social/email login)
Applied to files:
.changeset/upset-pears-unite.md
📚 Learning: applies to packages/thirdweb/src/wallets/** : eip-1193, eip-5792, eip-7702 standard support in walle...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules
Applied to files:
.changeset/upset-pears-unite.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Unit Tests
- GitHub Check: Size
- GitHub Check: Lint Packages
- GitHub Check: Analyze (javascript)
| "thirdweb": patch | ||
| --- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a minor bump, not patch, for new public functionality
Per SemVer, adding a new backwards-compatible feature (the buttonLabel prop) warrants a minor version increment. Reserving patch for bug fixes avoids under-signalling changes to downstream consumers.
-"thirdweb": patch
+"thirdweb": minor📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "thirdweb": patch | |
| --- | |
| "thirdweb": minor | |
| --- |
🤖 Prompt for AI Agents
In the .changeset/upset-pears-unite.md file at lines 2 to 3, change the version
bump type from "patch" to "minor" because the addition of the new public
`buttonLabel` prop is a backwards-compatible feature and should be reflected as
a minor version increment according to SemVer guidelines.
Slack Thread
PR-Codex overview
This PR introduces the ability to customize button labels across various payment widgets in the
thirdwebpackage, enhancing user interface flexibility.Detailed summary
buttonLabelprop to various components for custom button text.BridgeOrchestrator,TransactionPayment,DirectPayment,FundWallet,TransactionWidget,CheckoutWidget, andBuyWidgetto utilizebuttonLabel.FundWallet,DirectPayment, andTransactionmodes.LeftSectionandRightSectionto support custom button label input.DirectPayment,FundWallet, andTransactionPayment.Summary by CodeRabbit
New Features
Documentation